package com.studerb.events;

import com.studerb.nntp.GroupCommandReply;
import com.studerb.nntp.NntpConnection;

public class NntpConnectionEvent {
    public enum EventType {
        CONNECTED, DISCONNECTED, EXCEPTION, COMMAND, GROUP
    }

    private NntpConnection connection;
    private EventType type;
    private Throwable throwable;
    private GroupCommandReply groupCommandReply;

    public NntpConnectionEvent(NntpConnection conn, EventType type) {
        this.connection = conn;
        this.type = type;
    }

    public NntpConnectionEvent(NntpConnection conn, EventType type, Throwable throwable) {
        this.connection = conn;
        this.type = type;
        this.throwable = throwable;
    }

    public NntpConnection getConnection() {
        return connection;
    }

    public Throwable getThrowable() {
        return throwable;
    }

    public EventType getType() {
        return type;
    }

    public void setConnection(NntpConnection connection) {
        this.connection = connection;
    }

    public void setThrowable(Throwable throwable) {
        this.throwable = throwable;
    }

    public void setType(EventType type) {
        this.type = type;
    }

    public GroupCommandReply getGroupCommandReply() {
        return groupCommandReply;
    }

    public void setGroupCommandReply(GroupCommandReply groupCommandReply) {
        this.groupCommandReply = groupCommandReply;
    }

}
